<template>
  <h1>Home</h1>
  <h2>{{ appStore.count }}</h2>
  <button @click="appStore.count = 3">改变count</button>
  <h2>{{ appStore.name }}</h2>
  <button @click="appStore.updateName('小明')">改变name</button>

  <h3>路由跳转</h3>
  <button @click="router.push('/about')">前往about</button>
  <button @click="router.push('/list')">前往list</button>
</template>

<script setup lang="ts">
import useApp from "@/store/app";
import { useRouter } from "vue-router";
const appStore = useApp();
const router = useRouter();
</script>

<style lang="scss" scoped>
h1 {
  color: red;
}
</style>
